<!-- <script src="http://code.jquery.com/jquery-2.1.4.min.js"></script> -->
<script src="__CDN__/assets/js/jquery-3.2.1.min.js" /></script>
<form id="add-form" class="form-horizontal form-ajax" role="form" data-toggle="validator" method="POST" action="">
    {:token()}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Group')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('group[]', $groupdata, null, ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
        </div>
    </div>
    <div class="form-group">
        <label for="username" class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" id="username" name="row[username]" value="" data-rule="required;username" />
        </div>
    </div>
    <!-- <div class="form-group">
        <label for="email" class="control-label col-xs-12 col-sm-2">{:__('Email')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="email" class="form-control" id="email" name="row[email]" value="" data-rule="required;email" />
        </div>
    </div> -->
    <div class="form-group">
        <label for="nickname" class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" id="nickname" name="row[nickname]" autocomplete="off" value="" data-rule="required" />
        </div>
    </div>
    <div class="form-group">
        <label for="password" class="control-label col-xs-12 col-sm-2">{:__('Password')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="password" class="form-control" id="password" name="row[password]" autocomplete="new-password" value="" data-rule="required;password" />
        </div>
    </div>
    <div class="form-group">
        <label for="phone" class="control-label col-xs-12 col-sm-2">{:__('手机号')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" id="phone" name="row[phone]" autocomplete="off" value="" data-rule="required" />
        </div>
    </div>
    <!-- <div class="form-group">
        <label for="code" class="control-label col-xs-12 col-sm-2">{:__('验证码')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" style="width:50%" id="code" name="row[code]" autocomplete="off" value=""  />
            <button type="button" id="btn" class="btn btn-success btn-embossed">{:__('发送验证码')}</button>
        </div>
    </div> -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')])}
        </div>
    </div>
    <div class="form-group hidden layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<script>
// $("#btn").click(function () {
//     var time = 60;
//     phone = $('#phone').val();
//     if(phone==''){
//         alert('请填写手机号');
//         return;
//     }
//     $.post("{:url('auth/admin/send_code')}",{phone:phone},function(res){
            
//             if(res.code==1){
//                 var timer = setInterval(function(){
//                 time--;
//                     $("#btn").text("（"+time+"秒）重发");
//                     if(time==0){
//                         clearInterval(timer);
//                         $(".tableText").text("获取验证码");
//                     }
//                 },1000);
//             }else{
//                 alert('发送失败');
//             }
        
//     });
    
// });
</script>